﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmListadoProductosEstablecimiento.aspx.cs" Inherits="frmListadoProductosEstablecimiento" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

       <h1> Administración de Productos Establecimiento
           <asp:Label ID="Label2" runat="server"></asp:Label>
       </h1>
       <p> 
           <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
               Text=" Filtrar sólo Productos con RNPA pendiente " />
       </p>
       <p> 
           <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
               AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="idProducto" 
               DataSourceID="SqlDataSource1" 
               EmptyDataText="No hay registros de datos para mostrar." BackColor="White" 
               BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" 
               CellSpacing="1" GridLines="None" 
               onselectedindexchanged="GridView1_SelectedIndexChanged">
               <Columns>
                   <asp:CommandField ShowSelectButton="True" HeaderText="Acciones" />
                   <asp:BoundField DataField="nroRNE" HeaderText="RNE Establecimiento" 
                       SortExpression="nroRNE" />
                   <asp:BoundField DataField="nroRNPA" HeaderText="RNPA" 
                       SortExpression="nroRNPA" ReadOnly="True" />
                   <asp:BoundField DataField="denominacion" HeaderText="Denominacion" 
                       SortExpression="denominacion" />
                   <asp:BoundField DataField="marca" HeaderText="Marca" SortExpression="marca" />
                   <asp:BoundField DataField="fantasia" HeaderText="Nombre Fantasia" 
                       SortExpression="fantasia" />
                   <asp:BoundField DataField="aptitud" HeaderText="Aptitud" 
                       SortExpression="aptitud" />
               </Columns>
               <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
               <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
               <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
               <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
               <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
               <SortedAscendingCellStyle BackColor="#F1F1F1" />
               <SortedAscendingHeaderStyle BackColor="#594B9C" />
               <SortedDescendingCellStyle BackColor="#CAC9C9" />
               <SortedDescendingHeaderStyle BackColor="#33276A" />
           </asp:GridView>
           <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
               ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
               DeleteCommand="UPDATE [T_Producto] SET [habilitado] = '0' WHERE [idProducto] = @idProducto" 
               InsertCommand="INSERT INTO [T_Producto] ([nroRNPA], [nroRNE], [denominacion], [marca], [fantasia], [codEnvase], [infoCompl], [marcoLegal], [tecnicaElab], [deterioro], [ensayo], [conserv], [aptitud], [modo]) VALUES (@nroRNPA, @nroRNE, @denominacion, @marca, @fantasia, @codEnvase, @infoCompl, @marcoLegal, @tecnicaElab, @deterioro, @ensayo, @conserv, @aptitud, @modo)" 
               SelectCommand="SELECT nroRNPA, nroRNE, denominacion, marca, fantasia, codEnvase, idProducto, infoCompl, marcoLegal, tecnicaElab, deterioro, ensayo, conserv, aptitud, modo FROM T_Producto WHERE (nroRNE = @nroRNE) AND (habilitado &gt; 0) AND (nroRNPA LIKE @like_temp)" 
               
               
               
               UpdateCommand="UPDATE [T_Producto] SET [nroRNPA] = @nroRNPA, [nroRNE] = @nroRNE, [denominacion] = @denominacion, [marca] = @marca, [fantasia] = @fantasia, [codEnvase] = @codEnvase, [infoCompl] = @infoCompl, [marcoLegal] = @marcoLegal, [tecnicaElab] = @tecnicaElab, [deterioro] = @deterioro, [ensayo] = @ensayo, [conserv] = @conserv, [aptitud] = @aptitud, [modo] = @modo WHERE [idProducto] = @idProducto">
               <DeleteParameters>
                   <asp:Parameter Name="idProducto" Type="Int32" />
               </DeleteParameters>
               <InsertParameters>
                   <asp:Parameter Name="nroRNPA" Type="String" />
                   <asp:Parameter Name="nroRNE" Type="Int32" />
                   <asp:Parameter Name="denominacion" Type="String" />
                   <asp:Parameter Name="marca" Type="String" />
                   <asp:Parameter Name="fantasia" Type="String" />
                   <asp:Parameter Name="codEnvase" Type="Int32" />
                   <asp:Parameter Name="infoCompl" Type="String" />
                   <asp:Parameter Name="marcoLegal" Type="String" />
                   <asp:Parameter Name="tecnicaElab" Type="String" />
                   <asp:Parameter Name="deterioro" Type="String" />
                   <asp:Parameter Name="ensayo" Type="String" />
                   <asp:Parameter Name="conserv" Type="String" />
                   <asp:Parameter Name="aptitud" Type="String" />
                   <asp:Parameter Name="modo" Type="String" />
               </InsertParameters>
               <SelectParameters>
                   <asp:ControlParameter ControlID="Label1" Name="nroRNE" PropertyName="Text" />
                   <asp:ControlParameter ControlID="Label3" Name="like_temp" PropertyName="Text" />
               </SelectParameters>
               <UpdateParameters>
                   <asp:Parameter Name="nroRNPA" Type="String" />
                   <asp:Parameter Name="nroRNE" Type="Int32" />
                   <asp:Parameter Name="denominacion" Type="String" />
                   <asp:Parameter Name="marca" Type="String" />
                   <asp:Parameter Name="fantasia" Type="String" />
                   <asp:Parameter Name="codEnvase" Type="Int32" />
                   <asp:Parameter Name="infoCompl" Type="String" />
                   <asp:Parameter Name="marcoLegal" Type="String" />
                   <asp:Parameter Name="tecnicaElab" Type="String" />
                   <asp:Parameter Name="deterioro" Type="String" />
                   <asp:Parameter Name="ensayo" Type="String" />
                   <asp:Parameter Name="conserv" Type="String" />
                   <asp:Parameter Name="aptitud" Type="String" />
                   <asp:Parameter Name="modo" Type="String" />
                   <asp:Parameter Name="idProducto" Type="Int32" />
               </UpdateParameters>
           </asp:SqlDataSource>
       </p>
       <p> 
           <asp:Label ID="Label4" runat="server"></asp:Label>
       </p>
       <p> 
           <asp:Label ID="Label5" runat="server"></asp:Label>
       </p>
       <p> 
           &nbsp;</p>
       <p> 
           <asp:Button ID="Button2" runat="server" Enabled="False" Height="29px" 
               onclick="Button2_Click" Text="Actualizar RNPA" Width="148px" />
&nbsp;
           <asp:TextBox ID="TextBox1" runat="server" Enabled="False" Height="28px" 
               Width="164px"></asp:TextBox>
       </p>
       <p> 
           &nbsp;</p>
<p> 
           <asp:Button ID="Button3" runat="server" Enabled="False" Height="32px" 
               onclick="Button3_Click" Text="Eliminar Producto Seleccionado" 
               Width="327px" />
       </p>
<p> 
           <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
       </p>
       <p> 
           <asp:Label ID="Label3" runat="server" Visible="False"></asp:Label>
       </p>
       <p> 
           &nbsp;</p>
       <p> 
           <asp:Button ID="Button1" runat="server" Height="29px" onclick="Button1_Click" 
               Text="Regresar" Width="158px" />
       </p>
</asp:Content>

